<html>
  <head>
    <meta charset="UTF-8" />
    <title>spine-pixi</title>
    <script src="https://cdn.jsdelivr.net/npm/pixi.js@7.4.2/dist/pixi.min.js"></script>
    <script src="../dist/iife/spine-pixi-v7.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/tweakpane@3.1.9/dist/tweakpane.min.js"></script>
    <link rel="stylesheet" href="../../index.css">
  </head>

  <body>
    <script>
      (async function () {
        var app = new PIXI.Application({
          width: window.innerWidth,
          height: window.innerHeight,
          resolution: window.devicePixelRatio || 1,
          autoDensity: true,
          resizeTo: window,
          backgroundColor: 0x333333,
          hello: true,
        });
        document.body.appendChild(app.view);

        // Pre-load the skeleton data and atlas. You can also load .json skeleton data.
        PIXI.Assets.add("snowglobeData", "/assets/snowglobe-pro.skel");
        PIXI.Assets.add("snowglobeAtlas", "/assets/snowglobe-pma.atlas");
        await PIXI.Assets.load(["snowglobeData", "snowglobeAtlas"]);

        // Create the spine display object
        const snowglobe = spine.Spine.from({skeleton: "snowglobeData", atlas: "snowglobeAtlas",
          scale: 0.25,
        });

        // Set animation "FOA" on track 0, looped.
        snowglobe.state.setAnimation(0, "shake", true);

        // Center the spine object on screen.
        snowglobe.x = window.innerWidth / 2;
        snowglobe.y = window.innerHeight / 2 + snowglobe.getBounds().height / 4;

        // Add the display object to the stage.
        app.stage.addChild(snowglobe);
      })();
    </script>
  </body>
</html>